home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs05.d81
/
evsbasic.arc
/
EVSKEYWORDS.G-I
< prev
next >
Wrap
Text File
|
2009-10-10
|
11KB
|
281 lines
---------------------------------------
GRAPHIC <mode>
The GRAPHIC statement sets the current graphic mode. <Mode> is a numeric
expression which normally ranges from 0 to 5, selecting one of the six
graphic modes provided by EVS Basic. In addition to setting the graphic
mode, executing this keyword also PAGEs the screen, disables all sprites,
and, if setting a bitmap mode, sets the current pen to Pen 1. Adding 16 to
the <mode> number causes the PAGE action to be suppressed, leaving both
screen and cursor in an unknown state. Adding 128 to the <mode> number
turns off the video display, which blanks the screen but also speeds up
text mode program execution by about 7% (bitmap modes are not affected).
The six basic graphic modes are described below:
Mode Screen Color Charset
0 Text Normal ROM
1 Text Normal RAM
2 Text Multi RAM
3 Text Extended RAM
4 Bitmap Multi RAM
5 Bitmap Normal RAM
A "Text" mode screen is a character-oriented screen of 1000 cells organized
as 40 columns by 25 rows. Each cell may contain any of 256 characters. A
"Bitmap" mode screen is a "dot"-oriented screen of 64,000 pixels organized
as 320 columns by 200 rows. Each pixel may be either on or off.
In any mode, the color of what is displayed on the screen depends heavily
upon 1000 color cells. These are very similar to the character cells of
the text screens and organized the same way. "Normal" color modes require
the paper color to be the same in all 1000 cells, but allow one different
ink color in each cell. "Multi" modes increase the number of different
colors in a single cell from two to four at the cost of resolution (each
dot in a multicolor character or bitmap pattern is twice as wide and there
are only half as many). "Multi" text permits one ink color and three paper
colors in a cell, while "multi" bitmap allows three ink colors and one
paper color. "Extended" text color is very much like "Normal" text color,
except that in exchange for reducing the number of different characters
allowed from 256 to 64 this mode permits one ink and any one of four paper
colors in a cell.
Graphic mode 0 uses the normal V2 Basic "ROM" character set that cannot be
altered by the programmer. The other modes share a "RAM" character set can
be altered (redefined) by use of the IMAGE statement.
Mode 0: this normal text mode is the same as the normal V2 Basic screen
display. It is the default EVS Basic mode. Any execution error resets
this mode so that the error message can always be read.
Mode 1: this normal text mode is the first mode in which sprites and
redefined character images can be made visible. Otherwise there is no
apparent difference between mode 0 and mode 1.
Mode 2: in multicolor text mode both normal and multicolor characters can
be displayed. What kind of character appears in a given screen cell is
determined by what its ink color is. Colors 0 to 7 give a normal
character, while colors 8 to 15 give multicolor characters.
Mode 3: in extended background color text mode the ink color of a cell is
determined as with modes 0 and 1, but which paper color a cell has is
determined by whether a character is printed as unshifted, shifted,
reversed, or shifted-reversed. No matter how it is printed it will appear
as the same unshifted character, but on different paper colors.
Mode 4: this is multicolor bitmap mode. Each cell can support three ink
colors in addition to the paper color. Resolution is lower in this mode
than in mode 5, so lines can appear more jagged and characters may appear
blockier.
Mode 5: this is normal bitmap mode, in which each cell can support only
the paper color and one ink color, but with twice the resolution of mode 4.
This mode can display smoother lines and more detailed characters.
Examples:
10 GRAPHIC 5
20 GRAPHIC A+16
---------------------------------------
IF <condition> THEN/GOTO <statements> [:ELSE <statements>]
The V2 Basic statement IF has been modified to accept an optional ELSE
statement on the same program line. Statements following ELSE are executed
only if <condition> is false. There is no other change to the behavior of
the IF statement.
Examples:
10 IF A>0 GOTO 90
20 IF A$=B$ THEN PRINT "YES": ELSE PRINT "NO"
---------------------------------------
IMAGE <exp>, <def$>
The IMAGE statement is used to define sprite and character images. Which
action is performed depends on whether <exp> is numeric or string. <Def$>
must contain the binary pattern of the image being defined.
If <exp> is numeric, IMAGE interprets it as a sprite image block number.
Sprite image block numbers may range from 0 to 206 (these are the same
image blocks that are assigned to sprites by SPRPIC. A sprite "looks like"
the image in the image block currently assigned to it). Only 18 of the
image blocks are guaranteed to be unused by EVS Basic for any other
purpose, however. All other image blocks will replace parts of either a
RAM character set or the bitmap screen. It is the programmer's
responsibility to ensure that any such replacements have no effect on the
program (for example, a program that only uses text modes will not be
affected by having the bitmap overwritten with sprite images). Potential
conflicts are outlined below:
Blocks Conflict
0-15 None
16-47 Uppercase Charset
48-79 Lowercase Charset
80-204 Bitmap
205-206 None
If <exp> is a string, the RAM charset pattern of the first character in the
string will be replaced by the pattern in <def$>. IMAGE replaces the RAM
character image only in the currently active character set, either the
uppercase/graphics set or the lowercase/uppercase set. An exception here
is that if the first character of the <exp> string is [RVS ON] (CHR$(18)),
the reversed image of the second character in <exp> will be replaced. If
the first character of <exp> is any other non-printable control character
or <exp> is the null string, an "?UNKNOWN CHAR" error will result.
IMAGE redefines as much of an image as possible, either until the image is
completely redefined or until there are no more characters in <def$> (in
which case the rest of the image is left as it is). A complete character
image is 8 characters long, a complete sprite image 63. The same sprite or
character image may be redefined as often as desired.
Images may be defined in any graphic mode but they cannot be seen in
graphic mode 0.
Examples:
10 IMAGE "A", B$
20 IMAGE A$, BIN$(B$)
30 FOR I= 1 TO 5: IMAGE I, A$(I): NEXT
---------------------------------------
INFIX$([<start>,] <source$>, <replace$> [,<length>])
The INFIX$() function returns a string in which characters from <replace$>
have overwritten characters in <source$> beginning at <start> and
continuing for <length> characters.
<Start> may range from 1 to 255. If <start> is not specified it is assumed
to be 1 and replacement begins with the first character of <source$>. If
<start> is larger than the length of <source$>, <source$> is returned.
<Source$> and <replace$> may be any legal string expressions. If <source$>
is the null string, the null string is returned. If <replace$> is the null
string, <source$> is returned.
<Length> may range from 0 to 255. If <length> is zero <source$> is
returned. If <length> is not specified it is assumed to be 255.
Replacement continues until <length> is reached or the end of <source$> or
<replace$> is reached, whichever comes first.
Examples:
10 A$= INFIX$("ABBBBB","B")
20 PRINT INFIX$(A$, B$, 5)
30 A$(I)= INFIX$(10, A$(I), "NULL RECORD")
---------------------------------------
INK [<ink1> [,<ink2> [,<ink3>]]]
INK sets the colors to be used by the three "pens". However, since in the
text modes pen 1 is always considered the active pen, only the changes made
to its color will be visible in those modes.
Ink colors may range from 0 to 15. There is no prohibition against two or
more pens sharing the same color. The default colors of pens 1, 2 and 3
are 14, 1 and 15, respectively.
Ink (foreground) colors differ from paper (background) colors in that the
ink color(s) can be different in each of the screen's 1000 color cells (a
color cell colors either one character (text modes) or 64 pixels in an 8x8
block (bitmap modes)).
Examples:
10 INK 14, 1, 15
20 INK , , A+2
30 INK , A(I)
---------------------------------------
INPUT$( <length> [,# <lf#>])
INPUT$() returns a string of <length> characters from the keyboard or a
logical file. INPUT$() accepts many characters which cause INPUT and
INPUT# to terminate (eg., commas, quote marks, semicolons, colons, and
[RETURN]). INPUT$() terminates execution only when the number of
characters input reaches the desired <length>. <Length> can be any value
from 0 to 255. A <length> of zero returns the null string.
If <lf#> is not specified INPUT$() accepts input from the keyboard (no
cursor is displayed). If a <lf#> is specified INPUT$() attempts to input
from the associated device. For tape and disk files, if the end-of-file
(EOF) marker is reached before <length> characters are input, INPUT$() will
return a string of however many characters have already been obtained.
This condition can be detected by checking the length of the returned
string and/or the status variable ST. INPUT$() is not recommended for use
with RS232 files.
Examples:
10 A$= INPUT$(1)
20 A$= INPUT$(B, #4)
30 A$= INPUT$(1, #2): B$= INPUT$(8, #2): IMAGE A$, B$
---------------------------------------
INSTR([<start>,] <source$>, <pattern$> [,<matchtype>])
The INSTR() function searches <source$> for occurrences of characters in
<pattern$> and returns either the position in <source$> at which the match
condition became true (successful) or zero if the match condition never
became true (unsuccessful).
<Start> may range from 1 to 255. If <start> is not specified it is assumed
to be 1 and matching attempt begins with the first character of <source$>.
If <start> is larger than the length of <source$>, zero is returned.
<Source$> and <pattern$> may be any legal string expressions. If either or
both are the null string, zero is returned.
<Matchtype> may range from 0 to 3. If <matchtype> is zero or not specified
<source$> is searched for an exact match to <pattern$> ("AND" search). If
<matchtype> is 1 <source$> is searched for the first character that does
not match any character in <pattern$> ("NOT" search). If <matchtype> is 2
<source$> is searched for the first character that matches any character in
<pattern$> ("OR" search). If <matchtype> is 3, INSTR() again searches for
an exact match, except that any "?" character in <pattern$> matches any
character in the same position in <source$> ("WILDCARD" search).
Examples:
10 PRINT INSTR("ABCDEF","C")
20 IF INSTR(A$, "1234567890", 1 )> 0 THEN PRINT "NOT NUMBER"
30 ON INSTR("RWQ", A$) GOSUB 100, 200, 300
40 A= INSTR(B, A$, "B?B", 3)